<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9">
<title>View Student Courses</title>
</head>
<style type="text/css">
th {text-align: right}
</style>
<body>

<?php include '../../top.html'; ?>
<?php include '../../authorization_check.php'; ?>
<?php include '../../checkStudentOnly.php'; ?>
<?php
	session_start();
	$studentID = $_SESSION['uname'];
	$year = $_SESSION['year'];
	$semester = $_SESSION['semester'];
	$programName = $_SESSION['programShortName'];
?>

<p>
<?php
	require_once '../../commonutils/db/DBConnectionManager.php';

	$sqlquery = "select * from student as s, event as e where s.programCode=e.programCode and studentID=".$studentID." and semesterID=".$year.$semester;
	
	//echo $sqlquery;
	$result = DBConnectionManager::query($sqlquery);

	if (mysql_num_rows($result) == 0)
	{
		echo "<br><center><h4>No events for ".$programName." program.</h4></center><br><br>";
	}
	else
	{
		echo "<center><table border=\"1\" width=\"62%\" id=\"table1\">";
		echo "<tr><td colspan=\"3\" height=\"20\"><center><h1>Events</h1></center></td></tr>";
		echo "<tr>";
		echo "<td width=\"373\" align=\"center\"><b>Event Description</b></td>";
		echo "<td width=\"191\" align=\"center\"><b>Start Date</b></td>";
		echo "<td width=\"161\" align=\"center\"><b>End Date</b></td>";
		echo "</tr>";
	
		
		while($row = mysql_fetch_assoc($result))
		{
			echo "<tr>";
			echo "<td width=\"373\">".$row['description']."</td>";
			echo "<td width=\"191\" align=\"center\">".$row['startDate']."</td>";
			echo "<td width=\"161\" align=\"center\">".$row['endDate']."</td>";
			echo "</tr>";
		}	
		echo "</table>";
		echo "</center>";	
	}
?>

</p>  

<br>
<hr color="blue">
<p>
<a href="../../StudentIndex.php"> Back </a>
</p>

</body>
</html>
	
